package com.example.sfm.pojo.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

import java.time.LocalDate;

@Data
@Accessors(chain = true)
@Schema(description = "学生档案传输对象",name = "StudentRecordsDto")
public class StudentRecordsDto {
    @Schema(description = "用户ID", deprecated  = true)
    @NotNull(message = "用户ID不能为空")
    private Integer userId;

    @Schema( description= "学号（长度6-20位）", deprecated = true)
    @NotBlank
    @Size(min = 6, max = 20)
    private String studentNumber;

    @Schema(description = "性别（0=未知,1=男,2=女）")
    @Range(min = 0, max = 2)
    private Integer gender;

    @Schema(description = "出生日期（格式：yyyy-MM-dd）")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate birthDate;

    @Schema(description = "国籍（长度2-50）")
    @Size(min = 2, max = 50)
    private String nationality;

    @Schema(description = "政治面貌")
    private String politicalStatus;

    @Schema(description = "入学日期（格式：yyyy-MM-dd）", deprecated = true)
    @NotNull @PastOrPresent
    private LocalDate admissionDate;

    @Schema(description = "所属学院（长度2-100）", deprecated = true)
    @NotBlank @Size(min = 2, max = 100)
    private String department;

    @Schema(description = "专业（长度2-50）", deprecated = true)
    @NotBlank @Size(min = 2, max = 50)
    private String major;

    @Schema(description = "班级名称")
    private String className;

    @Schema(description = "家庭地址")
    private String address;

    @Schema(description = "监护人姓名")
    private String guardianName;

    @Schema(description = "监护人电话")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
    private String guardianPhone;

    @Schema(description = "班级ID")
    private Integer classId;
}
